package main

import (
	"fmt"

	"github.com/tidwall/gjson"

	sjson "github.com/json-iterator/go"
)

var (
	jStr = `{"name":{"first":"Janet","last":"Prichard"},"age":47}`
)

func say() {
	fmt.Println("hello, world")

}

func main() {
	test2()
}

func test1() {

	// gjson.GetMany(jStr, path)

	value := gjson.Parse(jStr)
	values := value.Array()
	for _, tmp := range values {
		fmt.Println(tmp.Array())
	}
}

func test2() {

	p := sjson.ParseString(sjson.ConfigDefault, jStr)

	fmt.Println(p.WhatIsNext())
	fmt.Println(p.ReadObject())
	// fmt.Println(p.Read())

	// fmt.Println(p.WhatIsNext() == sjson.NumberValue)
	fmt.Println(p.ReadObject())
	fmt.Println(p.Read())

	// fmt.Println(p.WhatIsNext())
	fmt.Println(p.ReadObject())
	fmt.Println(p.Read())
	// fmt.Println(p.WhatIsNext())

}
